import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
import Layout from '@/layout'

const routes = [
    {
        path: '/redirect',
        component: Layout,
        meta: {authority: [0], id: 20000},
        children: [
            {
                meta: {authority: [100], id: 20000},
                path: '/redirect/:path(.*)',
                component: () => import(/* webpackChunkName: "redirect-index" */ '@/views/redirect/index')
            }
        ]
    },
    {
        path: '/',
        redirect: '/login',
        meta: {authority: [0]},
    }, {
        path: '/login',
        name: 'login',
        meta: {authority: [0]},
        component: () => import(/* webpackChunkName: "login" */ '@/views/login')
    }, {
        path: '/dashboard',
        name: 'dashboard',
        component: Layout,
        redirect: '/dashboard/index',
        meta: {title: '首页', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-s-home'},
        children: [{
            path: 'index',
            name: 'index',
            meta: {title: '首页', authority: [100]},
            component: () => import(/* webpackChunkName: "dashboard" */ '@/views/dashboard')
        }]
    },
    {
        path: '/test1',
        name: 'test1',
        component: Layout,
        redirect: '/test1/index',
        meta: {title: '测试', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-s-home'},
        children: [{
            path: 'index',
            name: 'index',
            meta: {title: '测试', authority: [100]},
            component: () => import(/* webpackChunkName: "test1" */ '@/views/test/test1')
        }]
    },

    {
        path: '/navigation0',
        name: 'navigation0',
        component: Layout,
        redirect: '/navigation0/navigation1',
        meta: {title: '客户管理', authority: [100], id: 20000, icon: 'el-icon-user'},
        children: [
            {
                path: 'navigation1',
                name: 'navigation1',
                meta: {title: '评价指标管理', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "navigation1" */ '@/views/navigation1')
            },
            {
                path: 'navigation2',
                name: 'navigation2',
                meta: {title: '客户列表', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "navigation2" */ '@/views/navigation2')
            },
            {
                path: 'navigation3',
                name: 'navigation3',
                meta: {title: '供应商列表', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "navigation3" */ '@/views/navigation3')
            },
        ]
    },


    {
        path: '/systemSettings',
        name: 'systemSettings',
        component: Layout,
        redirect: '/systemSettings/roleSetUp',
        meta: {title: '系统设置', authority: [100], id: 20000, icon: 'el-icon-setting'},
        children: [
            {
                path: 'roleSetUp',
                name: 'roleSetUp',
                meta: {title: '角色设置', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "/systemSettings/roleSetUp" */ '@/views/systemSettings/roleSetUp')
            }, {
                path: 'accountSettings',
                name: 'accountSettings',
                meta: {title: '账号设置', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "/systemSettings/accountSettings" */ '@/views/systemSettings/accountSettings')
            }, {
                path: 'navigation47',
                name: 'navigation47',
                meta: {title: '审批模板配置', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "navigation47" */ '@/views/navigation47')
            }, {
                path: 'systemLog',
                name: 'systemLog',
                meta: {title: '系统日志', authority: [100], id: 20000},
                component: () => import(/* webpackChunkName: "/systemSettings/systemLog" */ '@/views/systemSettings/systemLog')
            }]
    },
]
const router = new VueRouter({
    routes
})
export default router
